package interview;

public class interview_16_10 {
    public int maxAliveYear(int[] birth, int[] death) {
        int[] num=new int[101];
        for(int i=0;i< birth.length;++i){
            for(int j=birth[i];j<=death[i];++j){
                num[j-1900]+=1;
            }
        }
        int max=1900;
        for(int i=1900;i<=2000;++i){
            if(num[max-1900]<num[i-1900]) max=i;
        }
        return max;
    }
}
